package com.crealth.db;

import java.util.List;
import com.crealth.manager.MybatisManager;
import com.crealth.model.KnowledgeCreditLoanModel;

public class KnowledgeCreditLoanDb {

	public static void insertKnowledgeCreditLoan(KnowledgeCreditLoanModel creditKnowledge) {
		MybatisManager.creditKnowledgeMapper.insertKnowledgeCreditLoan(creditKnowledge);
		MybatisManager.commit();
	}
    
    public static List<KnowledgeCreditLoanModel> selectAllKnowledgeCreditLoan() {
    	List<KnowledgeCreditLoanModel> creditKnowledgels = MybatisManager.creditKnowledgeMapper.selectAllKnowledgeCreditLoan();
    
    	return creditKnowledgels;
    }
    
    public static List<KnowledgeCreditLoanModel> selectCityNameKnowledgeCreditLoan(String cityName) {
    	List<KnowledgeCreditLoanModel> creditKnowledgels = MybatisManager.creditKnowledgeMapper.selectCityNameKnowledgeCreditLoan(cityName);
    
    	return creditKnowledgels;
    }
    
    public static KnowledgeCreditLoanModel selectKnowledgeCreditLoanByName(String name) {
    	KnowledgeCreditLoanModel klg = MybatisManager.creditKnowledgeMapper.selectKnowledgeCreditLoanByName(name);
    	
    	return klg;
    }
    
    public static Integer updateKnowledgeCreditLoanByID(KnowledgeCreditLoanModel creditKnowledge) {
    	Integer res = MybatisManager.creditKnowledgeMapper.updateKnowledgeCreditLoanByID(creditKnowledge);
    	MybatisManager.commit();
    	
    	return res;
    }
    
    public static Integer deleteCreditKnowledgeByID(int id) {
    	Integer res = MybatisManager.creditKnowledgeMapper.deleteCreditKnowledgeByID(id);
    	MybatisManager.commit();
    	
    	return res;
    }
	
	
}
